package com.example.demo;

public class BuilderDemo {

    public static void main(String[] args) {
        Test a =Test.builder().a("a").build();
        System.out.println(a);
    }
    public  static class  Test{
        private String a;
        public static TestBuilder builder(){
            return  new TestBuilder();
        }
        public  static  class TestBuilder{
            private String a;
            public TestBuilder a(String a){
                this.a=a;
                return  this;
            }
            public Test build(){
                Test test=new Test();
                test.a=this.a;
                return test;
            }
        }
    }
}
